Skip to content

Show anchor links for each heading#433

Merged
yamgent merged 1 commit into
MarkBind:masterfrom
jamos-tay:add-anchors
Sep 28, 2018
Merged

Show anchor links for each heading#433
yamgent merged 1 commit into
MarkBind:masterfrom
jamos-tay:add-anchors

Conversation

@jamos-tay

@jamos-tay jamos-tay commented Sep 18, 2018

Copy link
Copy Markdown
Contributor

What is the purpose of this pull request? (put "X" next to an item, remove the rest)

• [X] New feature

Fixes #426

What is the rationale for this request?

Users may want to share a link to a specific heading with others.

What changes did you make? (Give an overview)

Allow users to automatically generate anchor links for each heading that direct the URL to that heading.

Provide some example code that this change will affect:

Users must include an anchors property in the frontmatter:

anchors: true

Functions similar to https://developers.timekit.io/v2/reference#section-root-endpoint-versions-and-protocol

  • Hovering over a header shows an anchor icon
  • Clicking on the icon links the URL to the header

out2

Is there anything you'd like reviewers to focus on?

Should we make the behavior different from the example site (e.g. change the icon)?

@jamos-tay jamos-tay changed the title [WIP] Show anchor links for each heading Show anchor links for each heading Sep 18, 2018
@yamgent

yamgent commented Sep 20, 2018

Copy link
Copy Markdown
Member

Users must include an anchors property in the frontmatter:

anchors: true

This seems kind of troublesome if there's a lot of such pages (if not all) in the website though (slightly similar to #389).

Was wondering whether we should add a default option in site.json, and explore a way to specify it for multiple pages at once...

@yamgent

yamgent commented Sep 20, 2018

Copy link
Copy Markdown
Member

Should we make the behavior different from the example site (e.g. change the icon)?

Design in the example gif looks fine actually. 👍

@damithc

damithc commented Sep 20, 2018

Copy link
Copy Markdown
Contributor

This seems kind of troublesome if there's a lot of such pages (if not all) in the website though (slightly similar to #389).

Maybe no need for this to be configurable? i.e., we do it by default for all headings

@yamgent

yamgent commented Sep 20, 2018

Copy link
Copy Markdown
Member

i.e., we do it by default for all headings

That sounds good too.

@jamos-tay

jamos-tay commented Sep 22, 2018

Copy link
Copy Markdown
Contributor Author

Updated to solve merge conflict and automatically add anchors

@yamgent yamgent left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the feature, works fine 👍.

Comment thread asset/js/setup.js
Comment thread docs/userGuide/contentAuthoring.md Outdated
Comment thread docs/userGuide/contentAuthoring.md Outdated
Comment thread docs/userGuide/contentAuthoring.md Outdated
Comment thread docs/userGuide/contentAuthoring.md Outdated
@jamos-tay

Copy link
Copy Markdown
Contributor Author

Updated

@yamgent yamgent left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor nit

Comment thread docs/userGuide/contentAuthoring.md Outdated
@yamgent yamgent added this to the v1.12.1 milestone Sep 28, 2018
@yamgent yamgent merged commit e23d8c8 into MarkBind:master Sep 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show anchor links for each heading

4 participants